<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1">
  <title id="ar20941">ALTER SYSTEM</title>
  <body>
    <p id="sql_command_desc">Changes a server configuration parameter.</p>
    <section id="section2">
      <title>Synopsis</title>
      <codeblock id="sql_command_synopsis">ALTER SYSTEM SET <varname>configuration_parameter</varname> { TO | = } { <varname>value</varname> | '<varname>value</varname>' | DEFAULT }

ALTER SYSTEM RESET <varname>configuration_parameter</varname>

ALTER SYSTEM RESET ALL</codeblock>
    </section>
    <section id="section3"><title>Description</title>
      <p>
        <codeph>ALTER SYSTEM</codeph> is used for changing server configuration parameters across
        the entire database cluster. <codeph>ALTER SYSTEM</codeph> writes the given parameter
        setting to the <codeph>postgresql.auto.conf</codeph> file, which is read in addition to
          <codeph>postgresql.conf</codeph>. Setting a parameter to <codeph>DEFAULT</codeph>, or
        using the <codeph>RESET</codeph> variant, removes that configuration entry from the
          <codeph>postgresql.auto.conf</codeph> file. Use <codeph>RESET ALL</codeph> to remove all
        such configuration entries. </p>
      
      <p> Values set with <codeph>ALTER SYSTEM</codeph> will be effective after the next server
        configuration reload (<codeph>gpstop -u</codeph>), or after the next server restart
          (<codeph>gpstop -r</codeph>) in the case of parameters that can only be changed at server
        start.</p>
      
      <p> Only superusers can use <codeph>ALTER SYSTEM</codeph>. Also, since this command acts
        directly on the file system and cannot be rolled back, it is not allowed inside a
        transaction block or function.</p>
    </section>
    <section id="section4"><title>Parameters</title>
    <parml>
      <plentry>
        <pt><varname>configuration_parameter</varname></pt>
        <pd>
          <p> Name of a settable configuration parameter. Available parameters are documented in
                <xref href="../config_params/guc-list.xml#topic3"/>.</p>
        </pd>
      </plentry>
      
      <plentry>
        <pt><varname>value</varname></pt>
        <pd>
          <p>
            New value of the parameter.  Values can be specified as string
            constants, identifiers, numbers, or comma-separated lists of
            these, as appropriate for the particular parameter.
            <codeph>DEFAULT</codeph> can be written to specify removing the
            parameter and its value from <codeph>postgresql.auto.conf</codeph>.
          </p>
        </pd>
      </plentry>
    </parml>
    </section>
    <section id="section5"><title>Notes</title> This command can't be used to set
        <codeph>data_directory</codeph>, nor parameters that are not allowed in
        <codeph>postgresql.conf</codeph> (e.g., preset options that are determined when Greenplum
      Database is compiled or when it is installed). <p> See <xref
          href="../../admin_guide/topics/g-configuring-the-greenplum-system.html#topic1" format="html" scope="external">Configuring the Greenplum Database System</xref> for other
        ways to set the parameters. </p></section>
    <section id="section6">
      <title>Examples</title>  <p> Set the <codeph>max_connections</codeph>:  </p>
      <codeblock>ALTER SYSTEM SET max_connections = 100;</codeblock>
      
      <p> Undo that, restoring whatever setting was effective in <codeph>postgresql.conf</codeph>:
        <codeblock>ALTER SYSTEM RESET max_connections;</codeblock>
      </p>
    </section>
    <section id="section7"><title>Compatibility</title>  <p>
      The <codeph>ALTER SYSTEM</codeph> statement is a
      Greenplum Database extension.
    </p>
    </section>
    <section id="section8"><title>See Also</title>
      <p><codeph><xref href="./SET.xml#topic1" type="topic" format="dita"/></codeph>, <codeph><xref
            href="./SHOW.xml#topic1" type="topic" format="dita"/></codeph></p></section>
  </body>
</topic>
